/****************************************
 ****************************************
 **   This document written by CTonk.  **
 **         ctonk@hotmail.com          **
 ****************************************
 ****************************************/

// spawn.cpp

#ifndef CPP_SPAWN
#define CPP_SPAWN

#include< iostream >
#include< process.h >

#define WAIT _P_WAIT
#define NOWAIT _P_NOWAIT
#define SILENT _P_DETACH
#define TAKEOVER _P_OVERLAY

void Spawn( int, char* );
void Spawn( int, char*, char* );
void Spawn( int, char*, const char* );
void Spawn( int, char*, std::string& );

//int main()
//{
//	Spawn( NOWAIT, "Mal Intent.exe" );
//	return 0;
//}

void Spawn( int mode, char* file )
{
	_spawnl( mode, file, "NULL", 0 );
	return;
}

void Spawn( int mode, char* file, char* arg )
{
	_spawnl( mode, file, arg, 0 );
	return;
}

void Spawn( int mode, char* file, const char* arg )
{
	_spawnl( mode, file, arg, 0 );
	return;
}

void Spawn( int mode, char* file, std::string& arg )
{
	_spawnl( mode, file, arg.data(), 0 );
	return;
}


#endif CPP_SPAWN // #ifndef CPP_SPAWN